﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DCTAccess.Business.LevelConfig
{
    public class Level
    {
        private int _id = -1;
        private int _level = -1;
        private int _numOfPeople = -1;
        private decimal _percent = 0;

        public decimal Percent
        {
            get { return _percent; }
            set { _percent = value; }
        }
        
        public int NumOfPeople
        {
            get { return _numOfPeople; }
            set { _numOfPeople = value; }
        }
        
        public int Level1
        {
            get { return _level; }
            set { _level = value; }
        }
        
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public Level() { }

        public Level(int id, int level, int num, decimal percent)
        {
            this.Id = id;
            this.Level1 = level;
            this.NumOfPeople = num;
            this.Percent = percent;
        }

        public Level(DataRow levelInfo)
        {
            this.Id = Convert.ToInt32(levelInfo["ID"].ToString());
            this.Level1 = Convert.ToInt32(levelInfo["LevelInfo"].ToString());
            this.NumOfPeople = Convert.ToInt32(levelInfo["NumOfPeople"].ToString());
            this.Percent = Convert.ToDecimal(levelInfo["percent"].ToString());
        }
    }
}
